var CandidateLanguage = {
	getLanguageType: function() {
		ajax({
			  url: baseURL + "ajax/get_language_type",
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#language').html(data);
			  }
			});
	},
	
	getLanguageLevel: function() {
		ajax({
			  url: baseURL + "ajax/get_language_level",
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#languageLevel').html(data);
			  }
			});
	},
	
	editLanguage: function(idlanguage) {
		$.facebox(function() {
			ajax({
			  url: baseURL + "candidate/language/edit/" + idlanguage,
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) { $.facebox(data) }
			});
		});
		
		return false;
	},
	
	processLanguage: function() {
		ajax({
		  url: baseURL + "candidate/language/" + ($('#idlanguage').val() ? 'update' : 'insert'),
		  cache: false,
		  type: "POST",
		  data: $('#ajax_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	deleteLanguage: function(idlanguage) {
		ajax({
		  url: baseURL + "candidate/language/delete",
		  cache: false,
		  type: "POST",
		  data: 'id=' + idlanguage,
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	getLanguageGrid: function() {
		ajax({
			  url: baseURL + "candidate/language",
			  cache: false,
			  type: "POST",
			  data: $('#ajax_form').serialize(),
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#gridLanguage').html(data);
			  }
			});
	}
};